<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test</title>
    <script src="lib/vue.js"></script>
</head>
<body>
<div id="app">
    <button-counter></button-counter>
    <button-counter></button-counter>
    <button-counter></button-counter>
    <button-counter></button-counter>
</div>
<template id="btn">
    <button @click="count++">你惦记了我{{count}}次</button>
</template>
</body>

<script>
    Vue.component("button-counter", {
        template: `#btn`,
        data() {

            return {count: 0};
        },
        // data: {
        //     count: 0
        // },
        methods: {
            add() {
                this.count++;
            }
        }
    });
    new Vue().$mount("#app");
</script>
</html>